#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
弹幕fm主程序
"""
import argparse
import logging

import requests
import json

logger = logging.getLogger('pytools')


def get_ip():
    content = requests.get('http://jsonip.com')
    ip_addr = json.loads(content.content)
    print(ip_addr['ip'])


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('action')
    args = parser.parse_args()
    if args.action == 'getip':
        get_ip()


if __name__ == "__main__":
    main()
